-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathmain.c
27 lines (22 loc) · 998 Bytes
/
main.c
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
#include <stdio.h>
#include <string.h>
int main(){
int n;
char jog1[7], jog2[7];
scanf("%d", &n);
while(n--){
scanf("%s", jog1);
scanf("%s", jog2);
if((strcmp(jog1, "ataque") == 0) && (strcmp(jog2, "pedra") == 0) || (strcmp(jog1, "pedra") == 0) && (strcmp(jog2, "papel") == 0) ||(strcmp(jog1, "ataque") == 0) && (strcmp(jog2, "papel") == 0))
printf("Jogador 1 venceu\n");
else if((strcmp(jog2, "ataque") == 0) && (strcmp(jog1, "pedra") == 0) || (strcmp(jog2, "pedra") == 0) && (strcmp(jog1, "papel") == 0) || (strcmp(jog1, "papel") == 0) && (strcmp(jog2, "ataque") == 0))
printf("Jogador 2 venceu\n");
else if((strcmp(jog1, "papel") == 0) && (strcmp(jog2, "papel") == 0))
printf("Ambos venceram\n");
else if((strcmp(jog1, "pedra") == 0) && (strcmp(jog2, "pedra") == 0))
printf("Sem ganhador\n");
else
printf("Aniquilacao mutua\n");
}
return 0;
}